<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"  xmlns:th="http://www.thymeleaf.org">
<head>
    <title>常用联系人</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <!-------------jquery库-------------->
  	<script type="text/javascript" src="js/jquery-1.8.3.min.js"></script>
	<!-------------Amazeui--------------->
    <script type="text/javascript" src="js/amazeui.js"></script>
    <link rel="stylesheet" type="text/css" href="css/amazeui.css">
    <!------------核心样式-------------->
    <link rel="stylesheet" type="text/css" href="/css/user.css">
	<link rel="stylesheet" type="text/css" href="/css/style.css">
</head>
<body>
<!-------------------版头c------------------->
<div th:replace="header-c"></div>
<!-----------------用户banner,快速导航---------------->
<div th:replace="header-my"></div>
<!-----------------框架---------------->
<div class="cw1000">
	<div class="w280 fl">
		<div class="public_box">
			<!-----------------设置导航---------------->
			<div id="set_nav">
				<ul>
					<ul>
						<li><a th:href="@{/my_info}"><i class="ico1"></i>我的信息</a></li>
						<li><a th:href="@{my_contact}"><i class="ico3"></i>收货地址</a></li>
						<li><a th:href="@{/security}"><i class="ico4"></i>修改密码</a></li>
					</ul>
				</ul>
			</div>
		</div>	
	</div>
	<div class="w700 fr">
		<div class="public_box">
			<!-----------------常用联系人---------------->
			<div id="set_box">
				<div class="title"><h2>常用联系人</h2></div>
				<form id="userForm" name="userForm" method="post" th:action="@{/my_contact}">
					<table class="table_list">
						<input type="hidden" name="_method" value="PUT" th:if="${null != contact.id}"/>
						<input type="hidden" name="id" th:value="${contact.id}"/>

						<tr>
							<th>姓名：</th>
							<td><input class="text" type="text" name="userName" id="userName" th:value="${contact.userName}"/></td>
						</tr>
						<tr>
							<th>所在地区：</th>
							<td>
								<input placeholder="请输入姓名" class="text" type="text" name="address1" id="address1" th:value="${contact.address1}"/>
								<input placeholder="请输入姓名" class="text" type="text" name="address2" id="address2" th:value="${contact.address2}"/>
							</td>
						</tr>
						<tr>
							<th>详细地址：</th>
							<td><input class="text" type="textarea" name="address3" id="adress3" th:value="${contact.address3}"/></td>
						</tr>
						<tr>
							<th>手机号码：</th>
							<td><input class="text" type="text" name="phone" id="phone" th:value="${contact.phone}"/></td>
						</tr>
						<tr>
							<th>邮政编码：</th>
							<td><input class="text" type="text" name="mail" id="mail" th:value="${contact.mail}"/></td>
						</tr>
					</table>
					<div class="operation"><input type="submit" class="save" value="保存" /></div>
				</form>
				<!-----------------联系列表---------------->
				<ul class="address">
					<li class="title">已保存<span th:text="${num}"></span>条地址，还能保存<span th:text="${num2}"></span>条</li>
					<!--contact:coantcat是我们遍历的集合中的每个元素，stat是thymeleaf为我们提供的列表状态属性，${contactList}是我们要遍历的对象集合-->
					<li th:each="contact, stat : ${contactList}">
						<div>
							<div class="dt">联系人：</div>
							<div class="dd"><span th:text="${contact.userName}">撒旦撒</span></div>
							<div class="clear"></div>
						</div>
						<div>
							<div class="dt">详细地址：</div>
							<div class="dd">
								<p><span th:text="${contact.address1}">澳门特别行政区</span>
									<span th:text="${contact.address2}">路氹城 </span></p>
								<p><span th:text="${contact.address3}">澳门特别行政区路氹城三顿饭都是富商大贾第三方</span></p>
							</div>
							<div class="clear"></div>
						</div>
						<div>
							<div class="dt">邮政编码：</div>
							<div class="dd" th:text="${contact.mail}">471000</div>
							<div class="clear"></div>
						</div>
						<div>
							<div class="dt">手机号码：</div>
							<div class="dd" th:text="${contact.phone}">13721656520</div>
							<div class="clear"></div>
						</div>
						<div class="i-first" th:text="${contact.isdefault == 1 ? '默认地址' : '设为默认地址'}" th:onclick="'upd('+ ${contact.Id} +')'" >默认地址</div>
							<div class="btns">
							<a th:href="@{/my_contact/{id}(id=${contact.id})}" data-id="183590" class="modifyThis">修改</a> / <a href="javascript:;" data-id="183590" class="delThis" th:onclick="'del('+ ${contact.id} +')'">删除</a>
						</div>
					</li>
<!--					<li>-->
<!--						<div>-->
<!--							<div class="dt">联系人：</div>-->
<!--							<div class="dd">三顿饭都是但是速度复式的</div>-->
<!--							<div class="clear"></div>-->
<!--						</div>-->
<!--						<div>-->
<!--							<div class="dt">详细地址：</div>-->
<!--							<div class="dd">-->
<!--								<p>澳门特别行政区 路氹城 </p>-->
<!--								<p>澳门特别行政区路氹城似懂非懂双方的首发但是</p>-->
<!--							</div>-->
<!--							<div class="clear"></div>-->
<!--						</div>-->
<!--						<div>-->
<!--							<div class="dt">邮政编码：</div>-->
<!--							<div class="dd">471000</div>-->
<!--							<div class="clear"></div>-->
<!--						</div>-->
<!--						<div>-->
<!--							<div class="dt">手机号码：</div>-->
<!--							<div class="dd">15670382580</div>-->
<!--							<div class="clear"></div>-->
<!--						</div>-->
<!--						<div class="i-first"><a style="text-decoration:none;" href="javascript:;" data-id="183593" class="setThisDefault">设为默认地址</a></div>-->
<!--						<div class="btns">-->
<!--							<a href="javascript:;" data-id="183593" class="modifyThis">修改</a> / <a href="javascript:;" data-id="183593" class="delThis">删除</a>-->
<!--						</div>-->
<!--					</li>-->
                </ul>
			</div>
		</div>	
	</div>
	<div class="clear"></div>
</div>
<script type="text/javascript" src="/js/contact.js"></script>
<!-------------------版尾------------------->
<div th:replace="footer"></div>
</body>
</html>